Skip to content

Add additional tests for processing fns#59

Merged
amrit110 merged 1 commit intomainfrom
add_tests_search_fns
Feb 18, 2026
Merged

Add additional tests for processing fns#59
amrit110 merged 1 commit intomainfrom
add_tests_search_fns

Conversation

@amrit110
Copy link
Copy Markdown
Member

This pull request adds comprehensive unit tests for the private helper functions _extract_summary_from_response and _extract_grounding_sources in the Google Search tool, significantly improving test coverage for these components. The new tests ensure robust handling of various edge cases, including empty inputs, missing attributes, filtering logic, and correct output formatting.

New tests for summary and source extraction helpers:

  • Added a new TestExtractSummaryFromResponse class with tests covering empty candidates, missing or empty content, handling of multiple text parts, skipping of invalid or empty parts, and ensuring only the first candidate is used.
  • Added a new TestExtractGroundingSources class with async tests for empty candidates, missing or empty grounding metadata, handling of chunks without web sources, order preservation, filtering of invalid URLs (including Vertex AI Search redirects), and mixed valid/filtered sources.

Test infrastructure improvements:

  • Updated imports to include AsyncMock, patch, and the tested helper functions. [1] [2]

@amrit110 amrit110 self-assigned this Feb 18, 2026
@amrit110 amrit110 added the tests Add or update unit or integration tests label Feb 18, 2026
@amrit110 amrit110 merged commit e78b622 into main Feb 18, 2026
3 checks passed
@amrit110 amrit110 deleted the add_tests_search_fns branch February 18, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Add or update unit or integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant